<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_orders', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('order_no')->default('');
            $table->integer('user_id')->default('0');
            $table->string('coupon_code')->nullable();
            $table->integer('goods_category_id')->default('0')->nullable()->comment('检测类目');
            $table->text('remark')->nullable();
            $table->decimal('sum_price')->default('0');
            $table->decimal('discount')->default('0')->nullable();
            $table->decimal('final_price')->default('0');
            $table->integer('payment_status')->default('0')->nullable();
            $table->string('payment_result')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_orders');
    }
}
